home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 266_01 / plox.c < prev    next >
C/C++ Source or Header  |  1990-07-20  |  2KB  |  56 lines

  1. /*                 MICRO PLOX                         FILE: PLOX.C
  2.                    Version 5.0
  3.      Copyright Robert L. Patton, Jr. 02 July 1990
  4.                1713 Parkcrest Terrace
  5.                Arlington, TX 76012
  6.   Reads a file of PLOX chart specification statements and executes
  7.   them as encountered to produce a binary file of plot commands.
  8.      WITH  CONLIB,DATLIB,DRAWLIB,MATHLIB,PXLIB,WORDLIB
  9. */
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include "PLOX.H"
  14. #include "DATLIB.H"
  15. #include "CONLIB.H"
  16. #include "WORDLIB.H"
  17. #include "PXLIB.H"
  18. #include "MATHLIB.H"
  19. #include "DRAWLIB.H"
  20. main (int ArgC, char **ArgV)
  21. {
  22.   #define LINE 81
  23.   #define LEN  12
  24.   char Sentence[LINE], Word[LEN+1];
  25.   FILE  *Control;
  26.  
  27.   printf("\n micro PLOX Version 5.0  07 Jul 1990\n\n");
  28.   if ((Control = fopen(ArgV[1],"r"))==NULL){
  29.     Capitalize (ArgV[1]);
  30.     printf("PLOX statements file, %s, not found.\n\n",ArgV[1]);
  31.   }
  32.   else {
  33.     if (ArgC > 2) AdHoc (ArgV[2]);
  34.     SavePlox (Control);
  35.     while (fgets(Sentence,LINE,Control) != NULL) {
  36.       Sentence[strlen(Sentence)-1] = '\0';
  37.       puts(Sentence);
  38.       Clean(Sentence);
  39.       GetWord (Sentence,Word,LEN);
  40.       Capitalize(Word);
  41.       if (Word[0]=='*' || Word[0]==' ');
  42.       else if (EQUAL (Word,"PIC"))   PCcon (Sentence);
  43.       else if (EQUAL (Word,"TITLE")) TLcon (Sentence);
  44.       else if (EQUAL (Word,"AREA"))  ARcon (Sentence);
  45.       else if (EQUAL (Word,"AXIS"))  AXcon (Sentence);
  46.       else if (EQUAL (Word,"LINE"))  LIcon (Sentence);
  47.       else if (EQUAL (Word,"BARS"))  BRcon (Sentence);
  48.       else if (EQUAL (Word,"LABEL")) LAcon (Sentence);
  49.       else if (EQUAL (Word,"ISO"))   IScon (Sentence);
  50.       else if (EQUAL (Word,"HUE"))   HUcon (Sentence);
  51.       else Unknown (Word);
  52.     }
  53.     PCcon ("CLOSE");
  54.   }
  55. }
  56.